package com.blog.backend.controller;

import com.blog.backend.annotation.LoginAnno;
import com.blog.backend.model.BlogFile;
import com.blog.backend.req.PersonReq;
import com.blog.backend.resp.PersonResp;
import com.blog.backend.service.PersonInfoService;
import com.blog.backend.utils.Result;
import com.blog.backend.vo.PageResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author fanggs
 * @Date 2021/7/16 0016 14:02
 */
@RestController
@Api(tags = "个人信息管理接口模块")
public class PersonInfoController {

    @Resource
    private PersonInfoService personInfoService;



    @PostMapping("/person/updateInfos")
    @LoginAnno
    @ApiOperation("修改个人信息")
    public Result updateInfos(@RequestBody PersonReq req){
        personInfoService.updateInfos(req);
        return Result.success();
    }

    @GetMapping("/person/queryDetails")
    @LoginAnno
    @ApiOperation("查询个人信息详情")
    public Result<PersonResp> queryDetails(){
        PersonResp resp = personInfoService.queryDetails();
        return Result.success(resp);
    }


}
